package com.fintech.third.service.moxie;

import retrofit2.Call;
import retrofit2.http.*;

import java.util.Map;

import com.fintech.third.model.moxie.RealNameAuthentication;
import com.fintech.third.model.moxie.alipay.MXAlipayReport;
import com.fintech.third.model.moxie.alipay.MXAlipayZmsReport;
import com.fintech.third.model.moxie.carries.AllDataDetails;
import com.fintech.third.model.moxie.carries.BillDetail;
import com.fintech.third.model.moxie.carries.MXUserReportCall;
import com.fintech.third.model.moxie.carries.MobileBasicV3;
import com.fintech.third.model.moxie.carries.NumberReport;
import com.fintech.third.model.moxie.carries.ShortMessageDetailV2;
import com.fintech.third.model.moxie.carries.VoiceCallDetailList;
import com.fintech.third.model.moxie.carriesv2.MXReport;
import com.fintech.third.service.moxie.task.TaskCreateReq;
import com.fintech.third.service.moxie.task.TaskCreateRsp;
import com.fintech.third.service.moxie.task.TaskStatusRsp;
import com.fintech.third.service.moxie.task.TaskVoidRsp;
import com.fintech.third.service.moxie.task.UserInput;

/**
 * 电信运营商
 */
public interface CarrierApi {

    /**
     * 创建任务
     *
     * @param req
     * @return
     */
    @POST("/carrier/v3/tasks")
    Call<TaskCreateRsp> createTask(@Body TaskCreateReq req);

    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @GET("/carrier/v3/tasks/{taskid}/status")
    Call<TaskStatusRsp> getTaskStatus(@Path("taskid") String taskId);

    /**
     * 输入验证码
     *
     * @param taskId
     * @return
     */
    @POST("/carrier/v3/tasks/{taskid}/input")
    Call<TaskVoidRsp> input(@Path("taskid") String taskId, @Body UserInput input);

    /**
     * 获取手机基本信息
     *
     * @param mobile
     * @param taskId
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/basic")
    Call<MobileBasicV3> getMobileBasic(@Path("mobile") String mobile, @Query("task_id") String taskId);

    /**
     * 获取账号账单记录
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/bill")
    Call<BillDetail> getBills(@Path("mobile") String mobile, @QueryMap Map<String, String> options);

    /**
     * 获取账号通话详情
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/call")
    Call<VoiceCallDetailList> getVoiceCalls(@Path("mobile") String mobile, @QueryMap Map<String, String> options);

    /**
     * 获取账号短信详情
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/sms")
    Call<ShortMessageDetailV2> getShortMessages(@Path("mobile") String mobile, @QueryMap Map<String, String> options);
    
    
    /**
     * 获取账号运营商全部数据的聚合接口
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/mxdata")
    Call<AllDataDetails> getAllDataDetails(@Path("mobile") String mobile, @Query("task_id") String taskId);
    
    
    
    /**
     * 获取号码分析报告
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/report")
    Call<NumberReport> getNumberReport(@Path("mobile") String mobile,@QueryMap Map<String, String> options);
    
    
    /**
     * 获取号码分析报告版本2
     *
     * @param mobile
     * @param options
     * @return
     */
    @GET("/carrier/v3/mobiles/{mobile}/mxreport")
    Call<MXReport> getNumberReportV2(@Path("mobile") String mobile,@QueryMap Map<String, String> options);
    
    
    
    
    /**
     * 用户手机号是否实名认证
     * @param mobile
     * @param options
     * @return
     */
    @GET("/tags/v1/carrierAuth")
    Call<RealNameAuthentication> getRealNameAuthentication(@QueryMap Map<String, String> options);
    
    
    /**
     * 获取魔蝎支付宝报告数据
     * @param taskId
     * @return
     */
    @GET("/gateway/alipay/v6/data/{taskid}")
    Call<MXAlipayReport> getAlipayReportV6(@Path("taskid") String taskId);
    
    /**
     * 获取魔蝎支付宝报告数据
     * @param taskId
     * @return
     */
    @GET("/gateway/alipay/v2/zmscore/{taskid}")
    Call<MXAlipayZmsReport> getAlipayZmsReportV2(@Path("taskid") String taskId);
    
    /**
     * 获取用户报告
     * @param taskId
     * @param event
     * @return
     */
    @GET("/gateway/callback/v1/tasks/{taskid}")
    Call<MXUserReportCall> getUserReportInfo(@Path("taskid") String taskId, @Query("event") String event);
}
